<script type="text/javascript"><!--//--><![CDATA[//><!--
    $(document).ready(function() {
    	
    	 //Setup Form
		$('#form_master').setupForm([			
			{ name: 'id_pembayaran', type: 'text', size: 'medium', maxlength: 255 },
			{ name: 'no_pembayaran', type: 'text', size: 'medium', maxlength: 255 },
			{ name: 'terbilang', type: 'text', size: 'long', maxlength: 40 },
			{ name: 'keterangan', type: 'text', size: 'long', maxlength: 40 },
			{ name: 'tanggal_bayar', type: 'date', size: 'short', maxlength: 15 },
			{ name: 'atas_nama', type: 'date', size: 'medium', maxlength: 15 },
			//{ name: 'total', type: 'text', size: 'medium', maxlength: 15 }
		], <?php echo json_encode($data); ?>);
		
		// Set Action Button
		var buttons = [{ label: 'Save', icon: 'save', onclick: function() { 
							$('#form_master').submitForm(	'/'+controller+'/ajax_post', 
							{ detail:[	{ table: 'dtl_sample2', field:['id_pembayaran','id_pembayaran_detail','keterangan_uraian','harga_satuan','banyak_satuan','total']}																	], 
							//onComplete : function(data){ eval('oData = '+data); loadPage('/'+controller+'/edit/?kode_penjualan='+(oData.genid!='' ? oData.genid : $('#kode_penjualan').getval())); }
							onComplete : function(data){ eval('oData = '+data); loadPage('/'+controller+'/index'); }
							}); 
						}},
					   { label: 'Close', icon: 'cancel', onclick: function() { loadPage('/'+controller+'/index'); } }];
		setAction(buttons);
		
		// Create Tab
		$('#tt').tabs({ border:false }); 

		// Focus at First Object
		$('#form_master').focusFirst();
		
		<?php
			if ($mode == 'edit') {
				?>
					var id_pembayaran_auto = "<?php echo $id_pembayaran_auto; ?>";
					$('#id_pembayaran').readonly();
				<?php
			}
			
		?>

		<?php
			if ($mode == 'create') {
				?>
					var no_pembayaran_auto = "<?php echo $no_pembayaran_auto; ?>";
					var id_pembayaran_auto = "<?php echo $id_pembayaran_auto; ?>";
					
					$('#id_pembayaran').setval(id_pembayaran_auto);
					$('#no_pembayaran').setval(no_pembayaran_auto);
				<?php
			}
			
		?>

		});
//--><!]]></script>
	
<div id="form_master_message" style="display:none;"></div>
<table class="tb_form" style="display:none;" cellpadding="0" cellspacing="0">
	 <tr>
        <td class="label">ID Pembayaran</td>
        <td><input id="id_pembayaran" /></td>
    </tr>
    <tr>
        <td class="label">Nomor Pembayaran</td>
        <td><input id="no_pembayaran" /></td>
    </tr>
    <tr>
        <td class="label">tanggal_bayar</td>
        <td><input id="tanggal_bayar" /></td>
    </tr>
    <tr>
        <td class="label">Keterangan</td>
        <td><textarea id="keterangan" name="keterangan" rows="3"/></td>
    </tr>
    <tr>
        <td class="label">Atas Nama</td>
        <td><input id="atas_nama"/></td>
    </tr>
    <tr>
        <td class="label">Opsi Pembayaran</td>
        <td><input type="radio" value="" >Cek  <input type="radio" value="" >Tunai  <input type="radio" value="" >Transfer</td>
    </tr>
</table>
<div id="tt" class="easyui-tabs" style="min-height:400px;"> 
	<div title="Detail" style="overflow:auto;padding:10px;">  
    	<?php require_once('formdtl_sample2.php'); ?>
    </div>
    
</div>